package com.goktech.olala.core.service;

import com.github.pagehelper.PageInfo;
import com.goktech.olala.core.req.ReqSysUser;
import com.goktech.olala.core.resp.RespPermissionVo;
import com.goktech.olala.core.resp.RespRoleVo;
import com.goktech.olala.core.resp.RespSysMenuVo;
import com.goktech.olala.core.resp.RespUserVo;
import com.goktech.olala.server.pojo.sys.SysUser;

import java.util.Collection;
import java.util.List;

/**
 * @author wusq
 * 系统用户service层接口
 */
public interface ISysUserService {
    /**
     * 多条件查询系统用户
     * @param reqSysUser
     * @return
     * @throws Exception
     */
    RespUserVo querySysUserByExample(ReqSysUser reqSysUser) throws Exception;

    /**
     * 查询角色
     * @param userId
     * @return
     * @throws Exception
     */
    List<RespRoleVo> queryRolesByUser(Long userId) throws Exception;

    /**
     * 得到用户权限
     * @param userId
     * @return
     * @throws Exception
     */
    List<RespPermissionVo> getPermissionByUser(Long userId) throws Exception;

    /**
     * 分页查询账户
     * @param reqSysUser
     * @param pageNum
     * @param pageSize
     * @return
     * @throws Exception
     */
    PageInfo<RespUserVo> queryAllAccountsForPage(ReqSysUser reqSysUser, Integer pageNum, Integer pageSize) throws Exception;

    /**
     * 通过id查询账号
     * @param userId
     * @return
     * @throws Exception
     */
    RespUserVo queryAccountInfoById(Long userId) throws Exception;

    /**
     * 修改用户的状态
     *
     * @param userId
     * @param status
     * @return
     * @throws Exception
     */
    int updateUserStatusById(Long userId, Integer status) throws Exception;

    /**
     * 系统用户新增
     * @param reqSysUser
     * @return
     * @throws Exception
     */
    int saveSysUserInfo(ReqSysUser reqSysUser) throws Exception;

    /**
     * 通过id删除
     * @param userId
     * @return
     * @throws Exception
     */
    int removeSysUserById(Long userId) throws Exception;

    /**
     * 分页查询菜单列表数据
     *
     * @param reqSysUser
     * @param pageNum
     * @param pageSize
     * @return
     * @throws Exception
     */
    PageInfo<RespSysMenuVo> queryAllMenusForPage(ReqSysUser reqSysUser, Integer pageNum, Integer pageSize) throws Exception;

    /**
     * 未分页查询菜单列表
     *
     * @param reqSysUser
     * @return
     * @throws Exception
     */
    List<RespSysMenuVo> queryAllSysMenus(ReqSysUser reqSysUser) throws Exception;

    /**
     * 通过角色查询菜单
     * @param roleId
     * @return
     * @throws Exception
     */
    List<RespSysMenuVo> querySysMenusByRole(Long roleId) throws Exception;

    /**
     *通过菜单id查询功能菜单
     * @param menuId
     * @return
     * @throws Exception
     */
    RespSysMenuVo querySysMenuInfoById(Long menuId) throws Exception;

    /**
     * 新增功能菜单
     * @param reqSysUser
     * @return
     * @throws Exception
     */
    int saveSysMenuInfo(ReqSysUser reqSysUser) throws Exception;

    /**
     * 通过id删除功能菜单
     * @param menuId
     * @return
     * @throws Exception
     */
    int removeSysMenuById(Long menuId) throws Exception;

    /**
     * 分页查询角色列表数据
     *
     * @param reqSysUser
     * @param pageNum
     * @param pageSize
     * @return
     * @throws Exception
     */
    PageInfo<RespRoleVo> queryAllRolesForPage(ReqSysUser reqSysUser, Integer pageNum, Integer pageSize) throws Exception;

    /**
     * 不分页查询角色列表数据
     *
     * @param reqSysUser
     * @return
     * @throws Exception
     */
    List<RespRoleVo> queryAllSysRoles(ReqSysUser reqSysUser) throws Exception;

    /**
     * 通过id查询角色
     * @param roleId
     * @return
     * @throws Exception
     */
    RespRoleVo querySysRoleInfoById(Long roleId) throws Exception;

    /**
     * 系统角色新增
     * @param reqSysUser
     * @return
     * @throws Exception
     */
    int saveSysRoleInfo(ReqSysUser reqSysUser) throws Exception;

    /**
     * 删除角色
     * @param roleId
     * @return
     * @throws Exception
     */
    int removeSysRoleById(Long roleId) throws Exception;

}
